﻿using System;

namespace OrderControl
{
    public class Customer
    {
        private string name;
        private string info;

        public string Name
        {
            get => name;
            set
            {
                if (!string.IsNullOrWhiteSpace(value))
                {
                    name = value;
                }
                else
                {
                    throw new OrderPropertyException("Customer name cannot be empty.");
                }
            }
        }
        public string Info { get => info; set => info = value; }

        public Customer(String name, String info)
        {
            Name = name;
            Info = info;
        }
        public Customer(String name) : this(name, "Null") { }
        public Customer() { }

        public override string ToString()
        {
            return "[Customer] Name: " + Name
                + ", Info: " + Info;
        }
    }
}
